core: Use ot_gfile_ prefix for new local GFile creation function
authorColin Walters <walters@verbum.org>
Fri, 18 Nov 2011 13:10:23 +0000 (08:10 -0500)
committerColin Walters <walters@verbum.org>
Fri, 18 Nov 2011 13:10:23 +0000 (08:10 -0500)
15 files changed:
src/libostree/ostree-checkout.c
src/libostree/ostree-core.c
src/libostree/ostree-repo-file.c
src/libostree/ostree-repo.c
src/libotutil/ot-gio-utils.c
src/libotutil/ot-gio-utils.h
src/osbuild/ob-builtin-buildone.c
src/ostree/ot-builtin-checksum.c
src/ostree/ot-builtin-commit.c
src/ostree/ot-builtin-compose.c
src/ostree/ot-builtin-diff.c
src/ostree/ot-builtin-fsck.c
src/ostree/ot-builtin-init.c
src/ostree/ot-builtin-pull.c
src/ostree/ot-builtin-show.c

index f992986546badeb77a5a28896439efba5a1291db..c4977ac2bd86f7c22bf7c00d8b99885557d6c8d0 100644 (file)
@@ -205,7 +205,7 @@ run_trigger (OstreeCheckout *self,
     {
       temp_path = g_build_filename (priv->path, basename, NULL);
       rel_temp_path = g_strconcat ("./", basename, NULL);
-      temp_copy = ot_util_new_file_for_path (temp_path);
+      temp_copy = ot_gfile_new_for_path (temp_path);
 
       if (!g_file_copy (trigger, temp_copy, 0, NULL, NULL, NULL, error))
         goto out;
@@ -310,7 +310,7 @@ ostree_checkout_run_triggers (OstreeCheckout *self,
   GFileEnumerator *enumerator = NULL;
 
   triggerdir_path = g_build_filename (LIBEXECDIR, "ostree", "triggers.d", NULL);
-  triggerdir = ot_util_new_file_for_path (triggerdir_path);
+  triggerdir = ot_gfile_new_for_path (triggerdir_path);
 
   enumerator = g_file_enumerate_children (triggerdir, OSTREE_GIO_FAST_QUERYINFO, 
                                           G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
@@ -333,7 +333,7 @@ ostree_checkout_run_triggers (OstreeCheckout *self,
       if (type == G_FILE_TYPE_REGULAR && g_str_has_suffix (name, ".trigger"))
         {
           child_path = g_build_filename (triggerdir_path, name, NULL);
-          child = ot_util_new_file_for_path (child_path);
+          child = ot_gfile_new_for_path (child_path);
 
           success = check_trigger (self, child, error);
         }
index 7e470460af47019fc940b5771e017604c1c8a60b..484fe340a0ea496568cb8c5442ceb421f8b9480f 100644 (file)
@@ -685,8 +685,8 @@ unpack_meta (const char   *path,
   GChecksum *ret_checksum = NULL;
   GFileOutputStream *out = NULL;
 
-  file = ot_util_new_file_for_path (path);
-  dest_file = ot_util_new_file_for_path (dest_path);
+  file = ot_gfile_new_for_path (path);
+  dest_file = ot_gfile_new_for_path (dest_path);
 
   if (out_checksum)
     ret_checksum = g_checksum_new (G_CHECKSUM_SHA256);
@@ -802,7 +802,7 @@ unpack_file (const char   *path,
   guint64 content_len;
   gsize bytes_read;
 
-  file = ot_util_new_file_for_path (path);
+  file = ot_gfile_new_for_path (path);
 
   if (!ostree_parse_packed_file (file, &metadata, &in, NULL, error))
     goto out;
@@ -815,7 +815,7 @@ unpack_file (const char   *path,
   mode = GUINT32_FROM_BE (mode);
   content_len = GUINT64_FROM_BE (content_len);
 
-  dest_file = ot_util_new_file_for_path (dest_path);
+  dest_file = ot_gfile_new_for_path (dest_path);
       
   if (out_checksum)
     ret_checksum = g_checksum_new (G_CHECKSUM_SHA256);
index 6c5eff40b4604354fcd251b9ce8f4b2c7413994b..0260a80cbe0a697898d539f43136d8c3827acf5e 100644 (file)
@@ -396,7 +396,7 @@ _ostree_repo_file_nontree_get_local (OstreeRepoFile  *self)
 
   checksum = _ostree_repo_file_get_checksum (self);
   path = ostree_repo_get_object_path (self->repo, checksum, OSTREE_OBJECT_TYPE_FILE);
-  ret = ot_util_new_file_for_path (path);
+  ret = ot_gfile_new_for_path (path);
   g_free (path);
   
   return ret;
@@ -703,7 +703,7 @@ get_child_local_file (OstreeRepo   *repo,
   GFile *ret;
 
   path = ostree_repo_get_object_path (repo, checksum, OSTREE_OBJECT_TYPE_FILE);
-  ret = ot_util_new_file_for_path (path);
+  ret = ot_gfile_new_for_path (path);
   g_free (path);
   
   return ret;
index 2b28fdc34d485bd2239734c44226429d6b540881..e99680ce29ab5814ebdc86815ffe66d7a42c029d 100644 (file)
@@ -134,7 +134,7 @@ ostree_repo_constructor (GType                  gtype,
 
   g_assert (priv->path != NULL);
   
-  priv->repo_file = ot_util_new_file_for_path (priv->path);
+  priv->repo_file = ot_gfile_new_for_path (priv->path);
   priv->tmp_dir = g_file_resolve_relative_path (priv->repo_file, "tmp");
   priv->local_heads_dir = g_file_resolve_relative_path (priv->repo_file, "refs/heads");
   priv->remote_heads_dir = g_file_resolve_relative_path (priv->repo_file, "refs/remotes");
@@ -610,7 +610,7 @@ write_gvariant_to_tmp (OstreeRepo  *self,
     }
 
   ret = TRUE;
-  *out_tmpname = ot_util_new_file_for_path (dest_name);
+  *out_tmpname = ot_gfile_new_for_path (dest_name);
   *out_checksum = checksum;
   checksum = NULL;
  out:
@@ -704,7 +704,7 @@ import_directory_meta (OstreeRepo  *self,
   GFile *f = NULL;
   GFileInfo *f_info = NULL;
 
-  f = ot_util_new_file_for_path (path);
+  f = ot_gfile_new_for_path (path);
 
   f_info = g_file_query_info (f, OSTREE_GIO_FAST_QUERYINFO,
                               G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
@@ -877,7 +877,7 @@ archive_file_trusted (OstreeRepo   *self,
   char *dest_path = NULL;
   char *dest_tmp_path = NULL;
 
-  infile = ot_util_new_file_for_path (path);
+  infile = ot_gfile_new_for_path (path);
 
   dest_path = prepare_dir_for_checksum_get_object_path (self, checksum, objtype, error);
   if (!dest_path)
@@ -885,7 +885,7 @@ archive_file_trusted (OstreeRepo   *self,
 
   dest_tmp_path = g_strconcat (dest_path, ".tmp", NULL);
 
-  outfile = ot_util_new_file_for_path (dest_tmp_path);
+  outfile = ot_gfile_new_for_path (dest_tmp_path);
   out = g_file_replace (outfile, NULL, FALSE, 0, NULL, error);
   if (!out)
     goto out;
@@ -1218,7 +1218,7 @@ add_one_file_to_tree_and_import (OstreeRepo   *self,
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
   g_assert (tree != NULL);
 
-  f = ot_util_new_file_for_path (abspath);
+  f = ot_gfile_new_for_path (abspath);
 
   if (!ostree_checksum_file (f, OSTREE_OBJECT_TYPE_FILE, &checksum, NULL, error))
     goto out;
@@ -1624,7 +1624,7 @@ ostree_repo_iter_objects (OstreeRepo  *self,
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
   g_return_val_if_fail (priv->inited, FALSE);
 
-  objectdir = ot_util_new_file_for_path (priv->objects_path);
+  objectdir = ot_gfile_new_for_path (priv->objects_path);
   enumerator = g_file_enumerate_children (objectdir, OSTREE_GIO_FAST_QUERYINFO, 
                                           G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
                                           NULL, 
@@ -1684,7 +1684,7 @@ ostree_repo_load_variant (OstreeRepo *self,
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   path = ostree_repo_get_object_path (self, sha256, OSTREE_OBJECT_TYPE_META);
-  f = ot_util_new_file_for_path (path);
+  f = ot_gfile_new_for_path (path);
   if (!ostree_parse_metadata_file (f, &ret_type, &ret_variant, error))
     goto out;
 
@@ -1722,7 +1722,7 @@ checkout_one_directory (OstreeRepo  *self,
   GVariant *xattr_variant = NULL;
 
   dest_path = g_build_filename (destination, dirname, NULL);
-  dest_file = ot_util_new_file_for_path (dest_path);
+  dest_file = ot_gfile_new_for_path (dest_path);
 
   if (!_ostree_repo_file_get_xattrs (dir, &xattr_variant, NULL, error))
     goto out;
index a140d7189fb11c360116823f7fa38c4c6316bc9a..42678a7b4b16cb4742a404af50e6125354699274 100644 (file)
@@ -36,7 +36,7 @@ ot_util_ensure_directory (const char *path, gboolean with_parents, GError **erro
   GError *temp_error = NULL;
   gboolean ret = FALSE;
 
-  dir = ot_util_new_file_for_path (path);
+  dir = ot_gfile_new_for_path (path);
   if (with_parents)
     ret = g_file_make_directory_with_parents (dir, NULL, &temp_error);
   else
@@ -66,7 +66,7 @@ ot_util_get_file_contents_utf8 (const char *path,
   GFile *file = NULL;
   char *ret = NULL;
 
-  file = ot_util_new_file_for_path (path);
+  file = ot_gfile_new_for_path (path);
   if (!ot_util_gfile_load_contents_utf8 (file, NULL, &ret, NULL, error))
     goto out;
 
@@ -142,7 +142,7 @@ ot_util_read_file_noatime (GFile *file, GCancellable *cancellable, GError **erro
 
 /* Like g_file_new_for_path, but only do local stuff, not GVFS */
 GFile *
-ot_util_new_file_for_path (const char *path)
+ot_gfile_new_for_path (const char *path)
 {
   return g_vfs_get_file_for_path (g_vfs_get_local (), path);
 }
index 8435b87b0ceaa1fc305586dff642190d2211429b..fcb4db7b50cfbb58c988085df5aac25cf2b8a524 100644 (file)
@@ -27,7 +27,7 @@
 
 G_BEGIN_DECLS
 
-GFile *ot_util_new_file_for_path (const char *path);
+GFile *ot_gfile_new_for_path (const char *path);
 
 const char *ot_gfile_get_path_cached (GFile *file);
 
index 13875631a9e3abe06e5cd5446dfa8a90862ace0b..e009b5d66ab0843d8315e5d18e839d152319658b 100644 (file)
@@ -95,7 +95,7 @@ open_log (const char *name,
   GFileOutputStream *ret_log = NULL;
 
   path = g_strdup_printf ("%s/%s.log", tmpdir, name);
-  logf = ot_util_new_file_for_path (path);
+  logf = ot_gfile_new_for_path (path);
 
   ret_log = g_file_replace (logf, NULL, FALSE, 0, NULL, error);
   if (!ret_log)
index 3cf2cb7d2227f96210b01f2e7881c3b625aa1496..d83e32715e4e54851d72d8ffa4eca8ffbca95861 100644 (file)
@@ -46,7 +46,7 @@ ostree_builtin_checksum (int argc, char **argv, const char *repo_path, GError **
     goto out;
 
   if (argc > 1)
-    f = ot_util_new_file_for_path (argv[1]);
+    f = ot_gfile_new_for_path (argv[1]);
   else
     {
       g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
index f12682e146c501d798f7e306fc6d929f326162e9..275e16dcd96de2da1ad2f3db82acbcc0baf792b1 100644 (file)
@@ -240,7 +240,7 @@ ostree_builtin_commit (int argc, char **argv, const char *repo_path, GError **er
         }
       else if (metadata_bin_path)
         {
-          metadata_f = ot_util_new_file_for_path (metadata_bin_path);
+          metadata_f = ot_gfile_new_for_path (metadata_bin_path);
           if (!ot_util_variant_map (metadata_f, G_VARIANT_TYPE ("a{sv}"), &metadata, error))
             goto out;
         }
@@ -295,7 +295,7 @@ ostree_builtin_commit (int argc, char **argv, const char *repo_path, GError **er
       out = (GOutputStream*)g_unix_output_stream_new (pipefd[1], TRUE);
       from_fd = pipefd[0];
 
-      fdata.dir = ot_util_new_file_for_path (dir);
+      fdata.dir = ot_gfile_new_for_path (dir);
       fdata.separator = separator;
       fdata.out = out;
       fdata.cancellable = NULL;
index 35856d0ba2b0fed468c51bbdfeaca0b55400aa67..c5f7e31bc967ec4a43047543699758d5dba8a979 100644 (file)
@@ -192,7 +192,7 @@ compose_branch_on_dir (OstreeRepo *repo,
   if (g_str_has_suffix (destpath, "/"))
     destpath[strlen (destpath) - 1] = '\0';
   branchpath = g_strconcat (destpath, "-tmp-checkout-", branchrev, NULL);
-  branchf = ot_util_new_file_for_path (branchpath);
+  branchf = ot_gfile_new_for_path (branchpath);
 
   g_print ("Checking out %s (commit %s)...\n", branch, branchrev);
   if (!ostree_repo_checkout (repo, branchrev, branchpath, NULL, error))
@@ -255,7 +255,7 @@ ostree_builtin_compose (int argc, char **argv, const char *repo_path, GError **e
     }
 
   destination = argv[1];
-  destf = ot_util_new_file_for_path (destination);
+  destf = ot_gfile_new_for_path (destination);
   
   if (compose_metadata_path)
     {
@@ -280,7 +280,7 @@ ostree_builtin_compose (int argc, char **argv, const char *repo_path, GError **e
                              "ostree-compose", g_variant_builder_end (&compose_metadata_builder));
       compose_metadata_builder_initialized = FALSE;
 
-      metadata_f = ot_util_new_file_for_path (compose_metadata_path);
+      metadata_f = ot_gfile_new_for_path (compose_metadata_path);
 
       commit_metadata = g_variant_builder_end (&commit_metadata_builder);
       if (!ot_util_variant_save (metadata_f, commit_metadata, NULL, error))
index b1982abf1a77aae8e3530786b50765c271e9c162..f48f04f7c4946ad57b6b2d891af6263ab49e8069 100644 (file)
@@ -45,7 +45,7 @@ parse_file_or_commit (OstreeRepo  *repo,
       || g_str_has_prefix (arg, "./")
       )
     {
-      ret_file = ot_util_new_file_for_path (arg);
+      ret_file = ot_gfile_new_for_path (arg);
     }
   else
     {
@@ -100,7 +100,7 @@ ostree_builtin_diff (int argc, char **argv, const char *repo_path, GError **erro
   src = argv[1];
   target = argv[2];
 
-  cwd = ot_util_new_file_for_path (".");
+  cwd = ot_gfile_new_for_path (".");
 
   if (!parse_file_or_commit (repo, src, &srcf, NULL, error))
     goto out;
index f9d748b6f16eee5ee969923456239b9c652b7a10..f6f0a1139276ca6c468308748800761df7a33d5a 100644 (file)
@@ -58,7 +58,7 @@ checksum_packed_file (OtFsckData   *data,
   gsize bytes_read;
   char buf[8192];
 
-  file = ot_util_new_file_for_path (path);
+  file = ot_gfile_new_for_path (path);
 
   in = g_file_read (file, NULL, error);
   if (!in)
@@ -132,7 +132,7 @@ object_iter_callback (OstreeRepo  *repo,
   char *dot;
   GFile *f = NULL;
 
-  f = ot_util_new_file_for_path (path);
+  f = ot_gfile_new_for_path (path);
 
   /* nlinks = g_file_info_get_attribute_uint32 (file_info, "unix::nlink");
      if (nlinks < 2 && !quiet)
index c58d63965b1cf8a575ffe21e14775492cbac3ab4..4749437df3f53e1f53bc0d777e48b797bf331098 100644 (file)
@@ -54,7 +54,7 @@ ostree_builtin_init (int argc, char **argv, const char *repo_path, GError **erro
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  repodir = ot_util_new_file_for_path (repo_path);
+  repodir = ot_gfile_new_for_path (repo_path);
 
   child = g_file_get_child (repodir, "config");
 
index bcf387b89a026a49aaf6126ad3e13ec57a47d0e3..0e14bffc3392943b6fe9bdede3c8e9a7cdf6c257 100644 (file)
@@ -94,7 +94,7 @@ fetch_uri (OstreeRepo  *repo,
       goto out;
     }
   close (fd);
-  tempf = ot_util_new_file_for_path (template);
+  tempf = ot_gfile_new_for_path (template);
 
   buf = soup_message_body_flatten (msg->response_body);
 
index 452a360d6e2a4ae3ab115a8f5e9c55b1bb0b3119..fac4e97ae7ef48fed9cc31f3b9b3b9e2897b48f2 100644 (file)
@@ -69,7 +69,7 @@ do_print_variant_generic (const GVariantType *type,
   GFile *f = NULL;
   GVariant *variant = NULL;
 
-  f = ot_util_new_file_for_path (filename);
+  f = ot_gfile_new_for_path (filename);
 
   if (!ot_util_variant_map (f, type, &variant, error))
     goto out;
@@ -120,7 +120,7 @@ do_print_packfile (OstreeRepo  *repo,
   path = ostree_repo_get_object_path (repo, checksum, OSTREE_OBJECT_TYPE_FILE);
   if (!path)
     goto out;
-  file = ot_util_new_file_for_path (path);
+  file = ot_gfile_new_for_path (path);
 
   if (!ostree_parse_packed_file (file, &variant, &content, NULL, error))
     goto out;